<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 14318
  Date: 2021/12/4
  Time: 0:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<form action="${pageContext.request.contextPath}/play_list" method="get">

    ID：<input type="text" name="id" value="${params.id}">
    房主：<input type="text" name="username_homer" value="${params.username_homer}">

    来访：<input type="text" name="username_visiter" value="${params.username_visiter}">
    <input type="hidden" name="username" value="${username}">

    <input type="submit" value="搜索">
    <a href="${pageContext.request.contextPath }/to_follow_list?username=${username}">我的关注列表</a>
    <a href="${pageContext.request.contextPath }/to_fan_list?username=${username}">我的粉丝列表</a>
    <%--<a href="${pageContext.request.contextPath }/apply?username=${username}">申请陪玩</a>--%>
    <a href="${pageContext.request.contextPath }/to_new_apply?username=${username}">新建陪玩</a>
    <a href="${pageContext.request.contextPath }/home_menu?username=${username}">我的陪玩</a>
    <a href="${pageContext.request.contextPath }/to_information?username=${username}">消息</a>

    当前用户为：${username}
</form>




    <table>

        <tr>
            <th>&nbsp;</th>
            <th>ID</th>
            <th>房主</th>
            <th>来访</th>
            <th>游戏类型</th>
            <th>游戏名称</th>
        </tr>

        <c:forEach items="${pageData.list}" var="play_list">

            <tr>

                <td><input type="checkbox" name="ids" value="${play_list.id }"/></td>
                <td>${play_list.id}</td>

                <td>${play_list.username_homer}</td>

                <td>${play_list.username_visiter}</td>

                <td>${play_list.game_type}</td>
                <td>${play_list.game_name}</td>



                <td><a href="${pageContext.request.contextPath}/check_home?id=${play_list.id }&username=${username}">查看</a></td> |
                <td><a href="${pageContext.request.contextPath}/join?id=${play_list.id }&username=${username}">申请加入</a></td>
<%--                <td><a href="${pageContext.request.contextPath}/delete/${student.id }">删除</a></td> |--%>
<%--                <td><a href="${pageContext.request.contextPath}/edit/${student.id }">修改</a></td>--%>
            </tr>

        </c:forEach>

        <tr>

            <td class="td2">

                <span>第${pageData.currPage}/ ${pageData.totalPage}页</span>

                <span>总记录数：${pageData.totalCount } 每页显示: ${pageData.pageSize}</span>

                <span>

              <c:if test="${pageData.currPage != 1}">

                  <a href="${pageContext.request.contextPath }/play_list?currentPage=1&username=${username}">[首页]</a>

                  <a href="${pageContext.request.contextPath }/play_list?currentPage=${pageData.currPage-1}&username=${username}">[上一页]</a>

              </c:if>

              <c:if test="${pageData.currPage != pageData.totalPage}">

                  <a href="${pageContext.request.contextPath }/play_list?currentPage=${pageData.currPage+1}&username=${username}">[下一页]</a>

                  <a href="${pageContext.request.contextPath }/play_list?currentPage=${pageData.totalPage}&username=${username}">[尾页]</a>

              </c:if>

            </span>

            </td>

        </tr>

    </table>

</form>
</body>
</html>
